/**
 * Copyright 2014 the original author or authors. All rights reserved.
 */
package com.visionet.security.support.jpa;

import org.springframework.data.domain.AuditorAware;

import com.visionet.security.support.UserContext;
import org.springframework.stereotype.Service;

/**
 * 
 *
 * @author suxiaojing
 * @date 
 * @since 0.0.1
 */
public class SystemAuditorAware implements AuditorAware<String> {

	/* (non-Javadoc)
	 * @see org.springframework.data.domain.AuditorAware#getCurrentAuditor()
	 */
	@Override
	public String getCurrentAuditor() {
		try{
			return UserContext.getUserId();
		}catch(Exception e){
			return "anonymous";
		}
	}

}
